
//express_demo.js 文件

const express = require('express');
const app = express();
const cors = require('cors')
const bodyparser = require('body-parser');
app.use(bodyparser.json()); //将请求转换成json格式
app.use(bodyparser.urlencoded({ extended: false }));
// 文章
var artListRouter = require('./module/artList')
//  成长史
var historyRouter = require('./module/history');
//  ；留言
var aboutRouter = require('./module/about');
app.use(cors())
app.use('/mongo', artListRouter)
app.use('/history', historyRouter);
app.use('/about', aboutRouter);

var server = app.listen(8080, function () {

  var host = server.address().address
  var port = server.address().port

  console.log("服务器开启", host, port)

})

